// 获取用户信息
function getAllinfo(){
  axios.get('/my/userinfo').then(({data:{data}}) => {

    //  console.log(data,status,message);
  
   let name = data.nickname||data.username
  //  console.log(data);
  if(data.user_pic){
     $('.avatar').attr('src',data.user_pic).show()
     $('.text-avatar-box').hide()
  }
  else{
    $('.text-avatar').html(name.substring(0,1).toUpperCase())
    $('.text-avatar-box').show()
    $('.avatar').hide()
  }
  $('#welcome').html(`欢迎 ${name}`)
  
  })
  const layer = layui.layer
  $('#btnLogout').on('click',function(){
    layer.confirm('确认退出吗?', {icon: 3, title:'提示'}, function(index){
      //do something
      layer.close(index);
      localStorage.removeItem('big-event-token')
      location.href='./login.html'
    });
  })
}
getAllinfo()
  function getClick(){
    $('#alist').click()
  }